package com.EAIPClub.CodeShellDebugDataGetter.controller;

import com.EAIPClub.CodeShellDebugDataGetter.service.CodeShellDebugDataGetterService;
import com.api.POJO.CodeLab.CodeShell.CodeShellDebugReturnBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * @Description :
 * @Author :
 * @Date : 2021/12/19
 */
@RestController
public class CodeShellDebugDataGetterController {

    private CodeShellDebugDataGetterService service;

    @Autowired
    public void setService(CodeShellDebugDataGetterService service) {
        this.service = service;
    }

    @GetMapping("/codeshell/readfile/{filename}")
    public CodeShellDebugReturnBean getData(@PathVariable String filename) throws IOException {
        return service.getData(filename);
    }
}
